/*
 * Selling Partner API for Messaging
 * With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the <a href=https://tools.ietf.org/html/draft-kelly-json-hal-08>JSON Hypertext Application Language</a> (HAL) standard.
 *
 * OpenAPI spec version: v1
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package software.amazon.spapi.models.messaging.v1;

import com.google.gson.annotations.SerializedName;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/** The request schema for the &#x60;createDigitalAccessKey&#x60; operation. */
@Schema(description = "The request schema for the `createDigitalAccessKey` operation.")
public class CreateDigitalAccessKeyRequest {
    @SerializedName("text")
    private String text = null;

    @SerializedName("attachments")
    private List<Attachment> attachments = null;

    public CreateDigitalAccessKeyRequest text(String text) {
        this.text = text;
        return this;
    }

    /**
     * The text that is sent to the buyer. Only links that are related to the digital access key are allowed. Do not
     * include HTML or email addresses. The text must be written in the buyer&#x27;s preferred language, which you can
     * retrieve from the &#x60;GetAttributes&#x60; operation.
     *
     * @return text
     */
    @Schema(
            description =
                    "The text that is sent to the buyer. Only links that are related to the digital access key are allowed. Do not include HTML or email addresses. The text must be written in the buyer's preferred language, which you can retrieve from the `GetAttributes` operation.")
    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public CreateDigitalAccessKeyRequest attachments(List<Attachment> attachments) {
        this.attachments = attachments;
        return this;
    }

    public CreateDigitalAccessKeyRequest addAttachmentsItem(Attachment attachmentsItem) {
        if (this.attachments == null) {
            this.attachments = new ArrayList<Attachment>();
        }
        this.attachments.add(attachmentsItem);
        return this;
    }

    /**
     * Attachments that you want to include in the message to the buyer.
     *
     * @return attachments
     */
    @Schema(description = "Attachments that you want to include in the message to the buyer.")
    public List<Attachment> getAttachments() {
        return attachments;
    }

    public void setAttachments(List<Attachment> attachments) {
        this.attachments = attachments;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CreateDigitalAccessKeyRequest createDigitalAccessKeyRequest = (CreateDigitalAccessKeyRequest) o;
        return Objects.equals(this.text, createDigitalAccessKeyRequest.text)
                && Objects.equals(this.attachments, createDigitalAccessKeyRequest.attachments);
    }

    @Override
    public int hashCode() {
        return Objects.hash(text, attachments);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class CreateDigitalAccessKeyRequest {\n");

        sb.append("    text: ").append(toIndentedString(text)).append("\n");
        sb.append("    attachments: ").append(toIndentedString(attachments)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /** Convert the given object to string with each line indented by 4 spaces (except the first line). */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}
